package com.tbit.uqbike.service.business.impl;

import com.tbit.uqbike.object.pojo.SystemMsg;
import com.tbit.uqbike.service.business.SystemMsgService;
import com.tbit.uqbike.webmanager.dao.core.SystemMsgDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("systemMsgService")
public class SystemMsgServiceImpl implements SystemMsgService {
    @Autowired
    private SystemMsgDao systemMsgDao;

    @Override
    public Integer queryCount(Integer accountId) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("accountId", accountId);

        return systemMsgDao.queryCount(params);
    }

    @Override
    public List<SystemMsg> queryPage(Integer accountId, Integer rowCount, Integer pageNO) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("accountId", accountId);
        params.put("start", (pageNO - 1) * rowCount);
        params.put("rowCount", rowCount);

        return systemMsgDao.queryPage(params);
    }

    @Override
    public void insert(SystemMsg systemMsg) {
        systemMsgDao.insert(systemMsg);
    }

    @Override
    public void del(Integer systemMsgId) {
        systemMsgDao.del(systemMsgId);
    }

}  